<!DOCTYPE html>
<html class="no-js" lang="">

<head>#include( "/public-head.html")
</head>

<body style="background-color: #ffffff !important;">
	<!-- main area -->
	<div class="main-content checkbo">
		<div class="panel mb25">
			<div class="panel-heading border">修改用户</div>
			<div class="panel-body">
				<div class="row no-margin">
					<div class="col-lg-12">
						<form action="/vrs/user/edit.jsn" data-url="/vrs/user/list.jsn" id="userForm" name="ajaxForm"
							class="form-horizontal bordered-group" role="form">
							<input type="hidden" name="user.userId" value="$!{user.userId}">
							<div class="form-group">
								<label class="col-sm-2 control-label">登录名</label>
								<div class="col-sm-10">
									<input type="text" name="user.userName" value="$!{user.userName}" class="form-control w150" placeholder="登录名" disabled="disabled">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">用户名</label>
								<div class="col-sm-10">
									<input type="text" required name="user.fullName" value="$!{user.fullName}" class="form-control w150" placeholder="用户名">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">邮箱</label>
								<div class="col-sm-10">
									<input type="email" required name="user.email" value="$!{user.email}" class="form-control w150" placeholder="邮箱">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label">重置密码</label>
								<div class="col-sm-10">
									<input type="password" id="passwordfield" onchange="checkPwd(this)" name="user.passWd" class="form-control w150" placeholder="重置密码">
								</div>
							</div>
							<div class="form-group">
								<label></label>
								<div>
									<button type="button" onclick="submitUserForm()" class="btn btn-primary mr10">修改</button>
									<button class="btn btn-default">返回</button>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>


	</div>
	<!-- /main area -->

	#include( "/public-script.html") #include( "/sub-script.html")
	<script>
		//初始化
		$('#userForm').validate();
		//校验密码
		function checkPwd(inp) {
			if (inp.value) {
				$('#passwordfield').rules("add", {
					required : true,
					minlength : 6
				});
			} else {
				$('#passwordfield').rules("remove", "required");
				$('#passwordfield').rules("remove", "minlength");
			}
		}

		//提交
		function submitUserForm() {
			if (!$('#userForm').valid()) {
				return false;
			} else {
				$('#userForm').submit();
			}
		}
	</script>
</body>

</html>
